from rest_framework.generics import ListAPIView

from home.models import Banner, Nav
from home.serializers import BannerModelSerializer, NavModelSerializer


class NavListAPIView(ListAPIView):
  """
  头部导航条菜单列表
  """
  queryset = Nav.objects.filter(is_show=True, is_deleted=False).order_by('orders')[:6]
  serializer_class = NavModelSerializer


class BannerListAPIView(ListAPIView):
  queryset = Banner.objects.filter(is_show=True, is_deleted=False).order_by('orders')[:5]
  serializer_class = BannerModelSerializer
